<template>
	<view class="page">
		<view class="page-top">
			<view class="user-wrap">
				<view class="icon-message" @click="toMessage">
					<u-icon name="bell" size="28"></u-icon>
					<view class="count">21</view>
				</view>
				<view class="user-box">
					<view class="user-photo">
						<u-icon name="account-fill" size="40" color="#fff"></u-icon>
					</view>
					<view class="user-login">
						<block v-if="isLogin">
							<view class="user-name">小水花</view>
							<view class="user-phone">134****1221</view>
						</block>
						<block v-else>
							注册登录
						</block>
					</view>
				</view>
				<view class="user-item">
					<view class="item" @click="toCoupon">
						<view class="val">1</view>
						<view class="lab">优惠券</view>
					</view>
					<view class="item item-2">
						<view class="val">12</view>
						<view class="lab">收藏</view>
					</view>
				</view>
			</view>
		</view>
		<view class="box-floor">
			<view class="hd-title">我的泳票</view>
			<view class="order-box">
				<view class="item-list">
					<view class="item">
						<i class="iconfont icon-payingY"></i>
						<view class="lab">待支付</view>
					</view>
					<view class="item">
						<i class="iconfont icon-ticket"></i>
						<view class="lab">待使用</view>
					</view>
					<view class="item">
						<i class="iconfont icon-menpiao1"></i>
						<view class="lab">已使用</view>
					</view>
					<view class="item">
						<i class="iconfont icon-quanbudingdan1"></i>
						<view class="lab">全部</view>
					</view>
				</view>
			</view>
		</view>
		<view class="user-list">
			<view class="item"  @click="toAboutUs">
				<view class="item-lab">
					<view class="icon">
						<image src="~@/static/image/icon-aboutus.svg"></image>
					</view>
					<view class="lab">关于我们</view>
				</view>
				<view class="item-arrow">
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<view class="item" @click="toChangeTel">
				<view class="item-lab">
					<view class="icon">
						<image src="~@/static/image/icon-edit.svg"></image>
					</view>
					<view class="lab">更改手机</view>
				</view>
				<view class="item-arrow">
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<view class="item">
				<view class="item-lab">
					<view class="icon">
						<image src="~@/static/image/icon-setting.svg"></image>
					</view>
					<view class="lab">设置</view>
				</view>
				<view class="item-arrow">
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isLogin:true,
			}
		},
		onLoad() {

		},
		methods: {
			toMessage(){
				uni.navigateTo({
					url:'/pages/messagelist/index'
				})
			},
			toAboutUs(){
				uni.navigateTo({
					url:'/pages/aboutus/index'
				})
			},
			toChangeTel(){
				uni.navigateTo({
					url:'/pages/changetel/index'
				})
			},
			toCoupon(){
				uni.navigateTo({
					url:'/pages/couponlist/index'
				})
			},
		}
	}
</script>

<style lang="scss">
	image{
		width: 100%;
		height: 100%;
	}
	.page-top{
		height: 300rpx;
		margin-bottom: 160rpx;
		background: linear-gradient($uni-color-theme 20%,#fff 100%);
		padding: 50rpx 30rpx 20rpx;
		.icon-message{
			position: absolute;
			right: 30rpx;
			top: 30rpx;
			.count{
				position: absolute;
				right: -6rpx;
				top: -6rpx;
				width: 30rpx;
				height: 30rpx;
				line-height: 30rpx;
				border-radius: 50%;
				background: #f00;
				color: #fff;
				font-size: 20rpx;
				text-align: center;
			}
		}
	}
	.user-wrap{
		position: relative;
		border-radius: 20rpx;
		overflow: hidden;
		padding: 0 30rpx 20rpx;
		background: #fff;
		box-shadow: 0rpx 0rpx 10rpx rgba(143,168,191,0.5);
	}
	.user-box{
		display: flex;
		align-items: center;
		padding: 40rpx 0;
		.user-photo{
			width: 120rpx;
			height: 120rpx;
			background: $uni-color-theme;
			display: flex;
			align-items: center;
			justify-content: center;
			border-radius: 50%;
			overflow: hidden;
			margin-right: 20rpx;
		}
		.user-login{
			color: $uni-color-theme;
			.user-name{
				font-size: 32rpx;
				color: #333;
				font-weight: bold;
			}
			.user-phone{
				margin-top: 10rpx;
				font-size: 28rpx;
				color: #666;
			}
		}
	}
	.user-item{
		display: flex;
		width: 100%;
		background: #fff;
		box-shadow: 0rpx 0rpx 10rpx rgba(143,168,191,0.5);
		padding: 20rpx 10rpx;
		.item{
			flex: 1;
			padding: 20rpx 10rpx;
			text-align: center;
			border-radius: 20rpx;
			.lab{
				margin-top: 10rpx;
				color: #999;
			}
		}
		.item-2{
			margin-left: 30rpx;
		}
	}
	.box-floor{
		margin-top: 20rpx;
		background: #fff;
		padding: 20rpx 30rpx;
		.hd-title{
			margin-bottom: 20rpx;
			font-size: 36rpx;
		}
	}
	.order-box{
		padding: 40rpx 10rpx;
		box-shadow: 0rpx 0rpx 10rpx rgba(143,168,191,0.5);
		border-radius: 20rpx;
		.item-list{
			display: flex;
			.item{
				flex: 1;
				text-align: center;
				.iconfont{
					font-size: 40rpx;
				}
				.lab{
					margin-top: 12rpx;
				}
			}
		}
	}
	.user-list{
		margin-top: 20rpx;
		background: #fff;
		padding-left: 30rpx;
		.item{
			display: flex;
			align-items: center;
			margin-top: 1rpx;
			justify-content: space-between;
			border-bottom: solid 1rpx #ddd;
			height: 88rpx;
			padding-right: 30rpx;
			.item-lab{
				display: flex;
				align-items: center;
			}
			.icon{
				margin-right: 12rpx;
				width: 32rpx;
				height: 32rpx;
			}
			.lab{
				font-size: 32rpx;
			}
		}
	}
	.user-list .item:last-child{
		border-bottom: none;
	}
</style>
